<template>
    <div>  
            <!-- :visible="visible" 我觉得可以删掉，删掉页没什么影响 -->
        <el-dialog title="新增图书" :visible="visible">
        <div><span>图书名称</span><el-input  class='elinput' v-model="data.btitle" ></el-input></div>
        <div><span>发布日期</span><el-input  class='elinput' v-model="data.bpub_date" ></el-input></div>
        <div><span>阅读量</span><el-input  class='elinput' v-model="data.bread"></el-input></div>
        <div><span>评论量</span><el-input  class='elinput' v-model="data.bcomment"></el-input></div>
        <el-button @click="cancel">取消</el-button>
        <el-button @click="addBook" type="primary">确定</el-button>
        </el-dialog>
    </div>

</template>

<script>
export default {
    props:['data','visible'],
    data() {
        return {
            
        }
    },
    methods: {
        cancel(){
            this.$emit('update:visible',false)
            
        },
        addBook(){
            this.$emit('update:visible',false)
            this.$emit('save')
        }
    },

}
</script>

<style>
.elinput {
  width: 220px;
  height: 40px;
}

</style>
